<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="p" %>
<% String ctx = request.getContextPath(); %>

<!-- 这个不能删 -->
<script type="text/javascript" src="<%=ctx%>/js/validators/flow.js"></script>

<div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
    <div style="height:24px;color:red;font-weight:bold" align="left">新增流向</div>
    <s:form id="submitForm" action="flow!save" method="post" theme="simple">
    <table width="100%">
    	<tbody>
    		<tr>
    			<td><s:text name="客户名称"/>：</td>
    			<td>
    				<select onchange="javascript:commonSelect(this,'flow.terminalName');" name="flow.terminalId" id="flow.terminalId">
		                <option value="">-- 请选择 --</option>
			            <s:iterator value="allTerminals" status="status">
			                <option value="${id}">${name}</option>
			            </s:iterator>
		            </select>
    			</td>
    			<td><s:text name="产品名称"/>：</td>
    			<td>
    				<select onchange="commonSelect(this,'flow.productName');chooseUnit(this,'<s:url action="flow!getBasicInfoById" namespace="/flow" />');" name="flow.productId" id="flow.productId">
		                <option value="">-- 请选择 --</option>
			            <s:iterator value="allProducts" status="status">
			                <option value="${id}">${name}</option>
			            </s:iterator>
		            </select>
    			</td>
    		</tr>
    		<tr>
    			<td><s:text name="上级连锁"/>：</td>
    			<td>
    				<select onchange="javascript:commonSelect(this,'flow.channelName');" name="flow.channelId" id="flow.channelId">
		                <option value="">-- 请选择 --</option>
			            <s:iterator value="allChannels" status="status">
			                <option value="${id}">${name}</option>
			            </s:iterator>
		            </select>
    			</td>
    			<td><s:text name="业务员"/>：</td>
    			<td>
    				<select onchange="javascript:commonSelect(this,'flow.inChargeUserName');" name="flow.inChargeUserId" >
		                <option value="">-- 请选择 --</option>
			            <s:iterator value="allChargePersons" status="status">
			                <option value="${id}">${userName}</option>
			            </s:iterator>
		            </select>
    			</td>
    		</tr>
    		<tr>
    			<td><s:text name="区域"/>：</td>
    			<td>
    				<select onchange="javascript:commonSelect(this,'flow.regionName');" name="flow.regionId" >
		                <option value="">-- 请选择 --</option>
		                <s:iterator value="allRegions" status="status">
		                    <option value="${id}">${name}</option>
		                </s:iterator>
		            </select>
    			</td>
    			<td><s:text name="销售日期"/>：</td>
    			<td>
    				<input readonly="true" id="deadLine" style="width:80px" name="flow.saleDate" onclick="return showCalendar('deadLine', 'y-mm-dd');" /><span></span>
    			</td>
    		</tr>
    		<tr>
    			<td><s:text name="月份"/>：</td>
    			<td><input type="text" name="flow.month" /></td>
    			<td><s:text name="数量"/>：</td>
    			<td><input style="width:80px;" type="text" name="flow.quantity" id="flow.quantity"><span id="unit"></span></td>
    		</tr>
    		<tr>
    			<td><s:text name="批号"/>：</td>
    			<td><input type="text" name="flow.number" /></td>
    			<td><s:text name="文件名"/>：</td>
    			<td><input type="text" name="flow.fileNamey" /></td>
    		</tr>
    		<tr>
    			<td><input type="submit" value="确认" onclick="return doValidate(event);" /></td>
    			<td colspan="3"><input type="button" value="取消" onclick="javascript:history.back(-1);"/></td>
    		</tr>
    	</tbody>
    </table>
    <input type="hidden" id="flow.regionName" name="flow.regionName">
    <input type="hidden" id="flow.inChargeUserName" name="flow.inChargeUserName">
    <input type="hidden" id="flow.terminalName" name="flow.terminalName">
    <input type="hidden" id="flow.productName" name="flow.productName">
    <input type="hidden" id="flow.channelName" name="flow.channelName">
    </s:form>
</div>